package _0_object_oriented;

import javax.annotation.Nullable;

/**
 * Created by bpzj on 8/16/2018.
 */
public class User {

    @Nullable
    private int age;
    private Integer height;

    // 这里：int 和 Integer 类型的区别：
    //      Integer可以是 null
    //      所以，无参构造器 中，会把 int 类型的赋值为 0
    //      而给 Integer 赋值为 null

    private String name;
    private OtherField otherField;

    public User() {
    }

    public User( String name,int age) {
        this.age = age;
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public OtherField getOtherField() {
        return otherField;
    }

    public void setOtherField(OtherField otherField) {
        this.otherField = otherField;
    }

    @Override
    public String toString() {
        return "User{" +
            "age=" + age +
            ", height=" + height +
            ", name='" + name + '\'' +
            ", otherField=" + otherField +
            '}';
    }
}
